package com.auto.survey.activity.test

import android.util.Log
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.google.gson.Gson
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

class TestViewModle  : ViewModel(){

    val blueToothCommunity= MutableLiveData<List<String>>()

    fun getBlueToothCommunity(data:List<String>) {
        viewModelScope.launch {
            val result = withContext(Dispatchers.IO){
                    data
            }
            Log.i("TestActivity", "TestViewModle result = ${Gson().toJson(result)}")
            blueToothCommunity.value = result


        }
    }



}